package com.kevin.utility.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Random.LJ
 *
 */
public enum TaskContentDatasourceType {
	
	/**
     * CLASS
     * 工作类
     */
    CLASS("class"),
    
    /**
     * database
     * 数据库
     */
    DATABASE("database"),
    
    /**
     * API
     * rest api接口（mq）
     */
    API("api");
    
    private String text;
    
    TaskContentDatasourceType(String text) {
        this.text = text;
    }
    
    public String getText() {
        return this.text;
    }
    
    private static final Map<String, TaskContentDatasourceType> stringToEnum = new HashMap<String, TaskContentDatasourceType>();
    static {
        for(TaskContentDatasourceType code : values()) {
            stringToEnum.put(code.toString(), code);
        }
    }
    
    public static TaskContentDatasourceType fromString(String symbol) {
        return stringToEnum.get(symbol);
    }

    @Override
    public String toString() {
        return text;
    }
}
